﻿/*
* Pztz.cs
*
* 功 能： 智能诊断-偏置调整模块的后台类
* 类 名： Pztz
*
* Ver    变更日期  20131126   负责人  黄永生  变更内容
* ───────────────────────────────────
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web.Security;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;
using Maticsoft.Common;
using DQYT.HTDZ.DBUtility;
using DQYT.HTDZ.BusinessService;
using System.Xml;
using System.Text;
using System.Drawing;
using DQYT.HTDZ.Common;
using DQYT.HTDZ.BLL;
using DQYT.HTDZ.Model;

namespace DQYT.HTDZ.Web.Views.Analysis
{
    public partial class Pztz : System.Web.UI.Page
    {
        private BDDATESOURCEModel bddatesoursemodel;
        private BDPULLModel bdpullmodel;
        private BDPOVERMACHINEModel djmodel;
        private BDVALUEModel valuemodel;

        private BDDATESOURSEBLL datesoursedll;
        private BDPULLBLL pullbll;
        private BDPOVERMACHINEBLL djbll;
        private BDVALUEBLL valuebll;
        private AnalysisFunc analysisFunc;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                init();
            }
        }
        /// <summary>
        /// 偏置率计算方法
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Btn_jisuan_Click(object sender, EventArgs e)
        {
            double sccjieshu = Convert.ToDouble(this.txt_sccjsgl.Text);//上冲程结束
            double scckaishi = Convert.ToDouble(this.txt_sccksgl.Text);//上冲程开始
            double glzdz = Convert.ToDouble(this.txt_glzdz.Text);//功率最大值
            double glzxz = Convert.ToDouble(this.txt_glzxz.Text);//功率最小值
            double pzl = System.Math.Abs(sccjieshu - scckaishi) / System.Math.Abs(glzdz - glzxz);
            this.txt_pzl.Text = pzl.ToString();

        }
        /// <summary>
        /// 初始化
        /// </summary>
        protected void init()
        {
            analysisFunc = new AnalysisFunc();
            initDdlWellID();
        }
        /// <summary>
        /// 初始化井号选择列表
        /// </summary> 
        protected void initDdlWellID()
        {
            DataTable dt = new DataTable();
            dt = analysisFunc.getWellidList();
            this.ddllwellid.Items.Clear();
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                ListItem item = new ListItem();
                item.Text = dt.Rows[i][0].ToString();
                item.Value = dt.Rows[i][0].ToString();
                this.ddllwellid.Items.Add(item);
                this.ddllwellid.DataBind();
            }

        }
    }
}